package com.ekuaitu.kuaitu.adapter;

import android.content.Context;

import com.ekuaitu.kuaitu.R;
import com.ekuaitu.kuaitu.base.BaseRcAdapterHelper;
import com.ekuaitu.kuaitu.base.BaseRcQuickAdapter;
import com.ekuaitu.kuaitu.bean.MyCardBean;
import com.ekuaitu.kuaitu.bean.MyMessageBean;
import com.ekuaitu.kuaitu.utils.TimeUtils;

import java.text.DecimalFormat;

/**
 * Created by Michael Pi on 2016/12/12.
 */

public class MyCardAdapter extends BaseRcQuickAdapter<MyCardBean.AttachmentBean.CardCouponModelsBean, BaseRcAdapterHelper> {


    public MyCardAdapter(Context context, int layoutResId) {
        super(context, layoutResId);
    }

    @Override
    protected void convert(BaseRcAdapterHelper helper, MyCardBean.AttachmentBean.CardCouponModelsBean item) {
        DecimalFormat df = new DecimalFormat("0");
        helper.setText(R.id.card_face_value, df.format(item.getDenomination()));
        helper.setText(R.id.card_date_from, TimeUtils.getFormatDate(item.getStartDate(), "yyyy.MM.dd"));
        helper.setText(R.id.card_date_end, TimeUtils.getFormatDate(item.getEndDate(), "yyyy.MM.dd"));
        helper.setText(R.id.card_code, item.getCode());
        helper.setText(R.id.card_brand, item.getBusinessName());
    }
}
